ESRI.ArcGIS.Mobile
GetDataReader(QueryFilter,String[]) Method
See Also  Example Send Feedback
ESRI.ArcGIS.Mobile.MobileServices Namespace > FeatureLayer Class > GetDataReader Method : GetDataReader(QueryFilter,String[]) Method

filter
columns
FeatureDataReader returns an implementation of ADO.NET System.Data.IDataReader providing access to data. The returned data is based on a query filter and it corresponds to the cached data and the edits.

Syntax

Visual Basic (Declaration) 
Public Overloads Function GetDataReader( _
   ByVal filter As QueryFilter, _
   ByVal ParamArray columns() As String _
) As FeatureDataReader
C# 
public FeatureDataReader GetDataReader( 
   QueryFilter filter,
   params string[] columns
)

Parameters

filter
columns

Example

Assuming that you've already had a map control map1 (and a MobileService attached to it), the following code example demonstrates how to use FeatureDataReader to get the geometry from the first layer in the MobileService that intersects current map extent.
C#Copy Code
FeatureLayer featureLayer = map1.MobileService.Layers[0] as FeatureLayer; 
QueryFilter qf = new QueryFilter(map1.GetEnvelope(), EsriGeometricRelationship.Intersect); 
FeatureDataReader dataReader = featureLayer.GetDataReader(qf); 
  
// Get geometry of the first original cached feature that intersects with current map extent. 
Geometry g; 
if (dataReader.Read()) 
    g = dataReader.GetGeometry(); 
else 
    MessageBox.Show("No feature found"); 
    

Remarks

Please note that, when you use a QueryFilter to get FeatureDataTable or FeatureDataReader, the result set will contain only features that are available from local MobileService. And local MobileService may contain a subset of a layer's data as defined in ArcGIS server. If you want to query against all the features in a layer, you need to make sure your local MobileService is a fully cached copy in the sense that it contains all data for the layer you want to apply the query.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also